<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<script>
   /* 0!=1;
    1!=1;
    2!=2*1;
    3!=3*2*1;
    4!=4*3*2*1;*/
    function factorial(n) {
        if (n <= 1){
            return 1;
        }else {
        return factorial (n - 1) * n }   //递归方法
    }
    console.log( factorial(8) )
</script>
</body>
</html>